/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef MOCK_OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_ERRORS_H
#define MOCK_OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_ERRORS_H

#include "errors.h"

namespace OHOS {
namespace AAFwk {
enum {
    ABILITY_MODULE_TYPE_SERVICE = 0,
    ABILITY_MODULE_TYPE_KIT = 1,
    ABILITY_MODULE_TYPE_CONNECTION_STATE_KIT = 2
};

constexpr ErrCode AAFWK_SERVICE_ERR_OFFSET = ErrCodeOffset(SUBSYS_AAFWK, ABILITY_MODULE_TYPE_SERVICE);

enum {
    RESOLVE_ABILITY_ERR = AAFWK_SERVICE_ERR_OFFSET,
    GET_ABILITY_SERVICE_FAILED,
    ABILITY_SERVICE_NOT_CONNECTED,
    RESOLVE_APP_ERR,
    ABILITY_EXISTED,
    CREATE_MISSION_STACK_FAILED,
    CREATE_ABILITY_RECORD_FAILED,
    START_ABILITY_WAITING,
    TERMINATE_LAUNCHER_DENIED,
    CONNECTION_NOT_EXIST,
    INVALID_CONNECTION_STATE,
    LOAD_ABILITY_TIMEOUT,
    CONNECTION_TIMEOUT,
    GET_BUNDLE_MANAGER_SERVICE_FAILED,
    REMOVE_MISSION_FAILED,
    INNER_ERR,
    GET_RECENT_MISSIONS_FAILED,
    REMOVE_STACK_LAUNCHER_DENIED,
    TARGET_ABILITY_NOT_SERVICE,
    TERMINATE_SERVICE_IS_CONNECTED,
    START_SERVICE_ABILITY_ACTIVATING,
    MOVE_MISSION_FAILED,
    KILL_PROCESS_FAILED,
    UNINSTALL_APP_FAILED,
    TERMINATE_ABILITY_RESULT_FAILED,
    CHECK_PERMISSION_FAILED,
    NO_FOUND_ABILITY_BY_CALLER,
    ABILITY_VISIBLE_FALSE_DENY_REQUEST,
    CALLER_ISNOT_SYSTEMAPP,
    GET_BUNDLENAME_BY_UID_FAIL,
    MISSION_NOT_FOUND,
    GET_BUNDLE_INFO_FAILED,
    KILL_PROCESS_KEEP_ALIVE,
    CLEAR_APPLICATION_DATA_FAIL,
    RESOLVE_CALL_NO_PERMISSIONS,
    RESOLVE_CALL_ABILITY_TYPE_ERR,
    RESOLVE_CALL_ABILITY_INNER_ERR,
    RESOLVE_CALL_ABILITY_VERSION_ERR,
    RELEASE_CALL_ABILITY_INNER_ERR,
    REGISTER_REMOTE_MISSION_LISTENER_FAIL,
    UNREGISTER_REMOTE_MISSION_LISTENER_FAIL,
    INVALID_USERID_VALUE,
    START_USER_TEST_FAIL,
    SEND_USR1_SIG_FAIL,
    ERR_AAFWK_HIDUMP_ERROR,
    ERR_AAFWK_HIDUMP_INVALID_ARGS,
    ERR_AAFWK_PARCEL_FAIL,
    ERR_IMPLICIT_START_ABILITY_FAIL,
    ERR_REACH_UPPER_LIMIT,
    ERR_AAFWK_INVALID_WINDOW_MODE,
    ERR_WRONG_INTERFACE_CALL,
    ERR_CROWDTEST_EXPIRED,
    ERR_APP_CONTROLLED,
    ERR_INVALID_CALLER,
    ERR_INVALID_CONTINUATION_FLAG,
    ERR_CROSS_USER,
    ERR_STATIC_CFG_PERMISSION,
    ERR_NOT_SYSTEM_APP,
    ERR_ECOLOGICAL_CONTROL_STATUS,
    ERR_APP_JUMP_INTERCEPTOR_STATUS,
    ERR_CODE_INVALID_URI_FLAG,
    ERR_CODE_INVALID_URI_TYPE,
    ERR_NOT_SELF_APPLICATION,
    ERR_EDM_APP_CONTROLLED,
    ERR_CODE_GRANT_URI_PERMISSION,
    ERR_COLLABORATOR_NOT_REGISTER,
    ERR_COLLABORATOR_NOTIFY_FAILED,
    ERR_NOT_SUPPORTED_PRODUCT_TYPE,
    ERR_INSIGHT_INTENT_START_INVALID_COMPONENT,
    ERR_NOT_DEVELOPER_MODE,
    ERR_GET_ACTIVE_ABILITY_LIST_EMPTY,
    ERR_QUERY_HIGHEST_PRIORITY_ABILITY,
    ERR_RESTART_APP_INCORRECT_ABILITY,
    ERR_RESTART_APP_FREQUENT,
    ERR_CONNECT_ERMS_FAILED,
    ERR_ABILITY_NOT_FOREGROUND,
    ERR_WUKONG_MODE_CANT_MOVE_STATE,
    ERR_OPERATION_NOT_SUPPORTED_ON_CURRENT_DEVICE,
    ERR_CAPABILITY_NOT_SUPPORT,
    ERR_NOT_ALLOW_IMPLICIT_START,
    ERR_START_OPTIONS_CHECK_FAILED,
    ERR_ABILITY_ALREADY_RUNNING,
    ERR_NATIVE_NOT_SELF_APPLICATION,
    ERR_NATIVE_IPC_PARCEL_FAILED,
    ERR_NATIVE_ABILITY_NOT_FOUND,
    ERR_NATIVE_ABILITY_STATE_CHECK_FAILED,
    ERR_KILL_PROCESS_NOT_EXIST,
    ERR_START_OTHER_APP_FAILED,
    ERR_NATIVE_MEMORY_SIZE_STATE_UNCHANGED,
    ERR_TARGET_BUNDLE_NOT_EXIST,
    ERR_GET_LAUNCH_ABILITY_INFO_FAILED,
    ERR_CHECK_PRELOAD_CONDITIONS_FAILED,
    ERR_SET_SUPPORTED_PROCESS_CACHE_AGAIN,
    ERR_URI_LIST_OUT_OF_RANGE,
    ERR_NOT_ALLOW_PRELOAD_BY_RSS,
    ERR_GET_ACTIVE_EXTENSION_LIST_EMPTY,
    GET_EXTENSION_NAME_BY_UID_FAIL,
    ERR_NO_RESIDENT_PERMISSION,
    ERR_APP_CLONE_INDEX_INVALID,
    ERR_MULTI_APP_NOT_SUPPORTED,
    ERR_UNLOCK_SCREEN_FAILED_IN_DEVELOPER_MODE,
    ERR_BLOCK_START_FIRST_BOOT_SCREEN_UNLOCK = 2097253,
    EXTENSION_BLOCKED_BY_THIRD_PARTY_APP_FLAG = 2097254,
    EXTENSION_BLOCKED_BY_SERVICE_LIST = 2097255,
    ERR_NOT_IN_APP_PROVISION_MODE = 2097256,
    ERR_SHARE_FILE_URI_NON_IMPLICITLY = 2097257,
    ERR_BUNDLE_NOT_EXIST,
    ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK = 2097259,
    ERR_FREE_INSTALL_TASK_NOT_EXIST = 2097260,
    ERR_KILL_FOUNDATION_UID = 2097261,
    ERR_CALLER_NOT_EXISTS = 2097262,
    ERR_NOT_SUPPORT_BACK_TO_CALLER = 2097263,
    ERR_NOT_SUPPORT_CHILD_PROCESS = 2097264,
    ERR_ALREADY_IN_CHILD_PROCESS = 2097265,
    ERR_CHILD_PROCESS_REACH_LIMIT = 2097266,
    ERR_NOT_DEBUG_APP = 2097267,
    ERR_NOT_SUPPORT_NATIVE_CHILD_PROCESS = 2097268,
    ERR_INSIGHT_INTENT_GET_PROFILE_FAILED = 2097269,
    ERR_ALL_APP_START_BLOCKED = 2097270,
    ERR_MULTI_INSTANCE_NOT_SUPPORTED = 2097271,
    ERR_APP_INSTANCE_KEY_NOT_SUPPORT = 2097272,
    ERR_UPPER_LIMIT = 2097273,
    ERR_CREATE_NEW_INSTANCE_NOT_SUPPORT = 2097274,
    ERR_INVALID_APP_INSTANCE_KEY = 2097275,
    ERR_NOT_SUPPORT_APP_CLONE = 2097276,
    ERR_INVALID_EXTENSION_TYPE = 2097277,
    ERR_INSIGHT_INTENT_EXECUTE_REPLY_FAILED = 2097278,
    ERR_GET_TARGET_BUNDLE_INFO_FAILED = 2097279,
    ERR_UI_ABILITY_IS_STARTING = 2097280,
    SET_SMS_FAILED = 2097281,
    ERR_GET_SPAWN_CLIENT_FAILED = 2097282,
    ERR_CREATE_START_MSG_FAILED = 2097283,
    ERR_SPAWN_PROCESS_FAILED = 2097284,
    ERR_RECORD_SIGNAL_REASON_FAILED = 2097285,
    ERR_GET_EXIT_INFO_FAILED = 2097286,
    ERR_NO_PERMISSION_CALLER = 2097287,
    ERR_NULL_APP_EXIT_REASON_HELPER = 2097288,
    ERR_READ_EXIT_REASON_FAILED = 2097289,
    ERR_IPC_PROXY_WRITE_FAILED = 2097290,
    ERR_INVALID_ACCESS_TOKEN = 2097291,
    ERR_GET_KV_STORE_HANDLE_FAILED = 2097292,
    ERR_WRITE_INTERFACE_TOKEN_FAILED = 2097296,
    ERR_WRITE_RESULT_CODE_FAILED = 2097297,
    ERR_READ_RESULT_PARCEL_FAILED = 2097298,
    ERR_NO_ALLOW_OUTSIDE_CALL = 2097299,
    ERR_APP_MGR_SERVICE_NOT_READY = 2097300,
    ERR_NULL_APP_RUNNING_MANAGER = 2097301,
    ERR_NULL_APP_MGR_SERVICE_INNER = 2097302,
    ERR_NULL_APP_MGR_PROXY = 2097303,
    ERR_NO_APP_RECORD = 2097304,
    ERR_EXTENSION_START_ABILITY_CONTROLEED = 2097305,
    CONNECT_MAMAGER_NOT_FIND_BY_USERID = 2097306,
    INVALID_CALLER_TOKEN = 2097307,
    EXTENSION_ABILITY_NOT_EXIST = 2097308,
    EXTENSION_ABILITY_INFO_NOT_QUERY_BY_URI = 2097309,
    EXTENSION_TYPE_NOT_UI_EXTENSION = 2097310,
    GET_LOCAL_DEVICE_ID_FAILED = 2097311,
    ERR_LOGOUT_USER_TASK_HANDLE_NULL = 2097318,
    ERR_LOGOUT_USER_APP_MANAGER_NULL = 2097319,
    ERR_LOGOUT_USER_KILL_PROCESS_TIMEOUT = 2097320,
    ERR_NULL_INTERCEPTOR_EXECUTER = 2097312,
    ERR_NULL_AFTER_CHECK_EXECUTER = 2097313,
    ERR_NULL_MISSION_LIST_MANAGER = 2097314,
    ERR_ABILITY_TYPE_INVALID = 2097315,
    ERR_NULL_UI_ABILITY_MANAGER = 2097316,
    ERR_NULL_SESSION_INFO = 2097317,
    ERR_NOT_HOOK = 2097321,
    ERR_FROM_WINDOW = 2097322,
    ERR_INVALID_CONTEXT = 2097323,
    INTENT_NOT_EXIST = 2097329,
    INTENT_STATE_NOT_EXECUTING = 2097330,

    ERR_PROCESS_START_INVALID_PID = 2097386,
    ERR_CODE_NOT_EXIST = 3000000,
};

enum {
    RECENT_IGNORE_UNAVAILABLE = 0x0002,
};

enum NativeFreeInstallError {
    FREE_INSTALL_OK = 0,
    FA_FREE_INSTALL_QUERY_ERROR = -1,
    HAG_QUERY_TIMEOUT = -4,
    FA_NETWORK_UNAVAILABLE = -2,
    FA_FREE_INSTALL_SERVICE_ERROR = 0x820101,
    FA_CRASH = 0x820102,
    FA_TIMEOUT = 0x820103,
    UNKNOWN_EXCEPTION = 0x820104,
    NOT_SUPPORT_PA_ON_SAME_DEVICE = -11,
    FA_INTERNET_ERROR = -3,
    JUMP_TO_THE_APPLICATION_MARKET_UPGRADE = -8,
    USER_GIVES_UP = -7,
    INSTALLATION_ERROR_IN_FREE_INSTALL = -5,
    HAP_PACKAGE_DOWNLOAD_TIMED_OUT = -9,
    CONCURRENT_TASKS_WAITING_FOR_RETRY = -6,
    FA_PACKAGE_DOES_NOT_SUPPORT_FREE_INSTALL = -10,
    NOT_ALLOWED_TO_PULL_THIS_FA = -901,
    NOT_SUPPORT_CROSS_DEVICE_FREE_INSTALL_PA = -12,
    FREE_INSTALL_TIMEOUT = 29360300,
    NOT_TOP_ABILITY = 0x500001,
    TARGET_BUNDLE_NOT_EXIST = 0x500002,
    DMS_PERMISSION_DENIED = 29360157,
    DMS_COMPONENT_ACCESS_PERMISSION_DENIED = 29360176,
    INVALID_PARAMETERS_ERR = 29360128,
    REMOTE_DEVICE_NOT_COMPATIBLE = 502,
    DEVICE_OFFLINE_ERR = 29360142,
    DMS_ACCOUNT_ACCESS_PERMISSION_DENIED = 29360175,
    INVALID_REMOTE_PARAMETERS_ERR = 29360131,
    ERR_NO_MAIN_ABILITY = 29360135,
    ERR_NO_STATUS_BAR_ABILITY = 29360136,
    ERR_NOT_ATTACHED_TO_STATUS_BAR = 29360137,
    BMS_NOT_CONNECTED = 29360138,
    CONTINUE_FREE_INSTALL_FAILED = 29360205,
    ATOMIC_SERVICE_MINIMIZED = 29360206,
    ERR_WRITE_INTERFACE_CODE = 29360210,
    ERR_WRITE_WANT = 29360211,
    ERR_WRITE_START_OPTIONS = 29360212,
    ERR_READ_WANT = 29360213,
    ERR_READ_START_OPTIONS = 29360214,
    ERR_WRITE_START_SELF_UI_ABILITY_RESULT = 29360215,
    UNDEFINE_ERROR_CODE = 3,
};
}  // namespace AAFwk
}  // namespace OHOS
#endif  // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_ERRORS_H
